package q2d.common.models.units;

import q2d.client.renderers.Animation;
import q2d.client.renderers.GFactory;
import q2d.client.worlds.GameWorld;
import q2d.client.renderers.GFactory;
import q2d.common.CollisionDetector;
import q2d.common.models.Map;
import q2d.common.models.units.Bullet;
import q2d.common.models.units.Player;


/** Player:
 * Jednostka uczestnika gry (gracza oraz przeciwnikow).
 */
public class Player extends Unit {

	public static final int RED_TEAM = 0;
	public static final int BLUE_TEAM = 1;
	public static final int BOUND_RADIUS = 34;// do rysowania w GameRenderer
	public static final int COLLISION_RADIUS = 18;// do obliczen kolizji w CollisionDetector

	// wartosci offsetow lufy broni w zaleznosci od rodzaju pistoletu
	// - do obliczen punktu wylotu pocisku z lufy
	public static final int WEAPON_1_BARREL_OFFSET_X = 0;
	public static final int WEAPON_1_BARREL_OFFSET_Y = -23;

	//  -----------------------------------------
	// informacje do komunikacji z serwerem
	public int x = 0;
	public int y = 0;
	public float rotation = 0;// w radianach
	public int team = RED_TEAM;
	public boolean hasFlag = false;// flaga mowiaca o tym czy gracz ma flage
	public int deathsCounter;
	//  -----------------------------------------

	// informacje do obliczania rotacji gracza
	public int screenX = 0;
	public int screenY = 0;

	//
	public String nick;//TODO zrobic z tego private i dodac metode setNick(..) ktora bedzie ucinac dluzsze nicki
	// HP gracza:
	public int health = 100;
	transient public Animation anim = new Animation();

	public Player(int _team){
		team = _team;
		if (team == BLUE_TEAM) anim.addFrame(GFactory.IMG_PLAYER_BLUE_1, 1, true);
		else anim.addFrame(GFactory.IMG_PLAYER_RED_1, 1, true);
		deathsCounter = 0;
	}

	
}
